#获取订单文件
import json
from flask import request
from db_client import *

def get_order_file():
        or_id = request.args.get('search')
        order_file = []
        result = mysql_client.get_order_file(or_id)
        for re in result:
                t = {
                        "id" : re[0],
                        "order_id" : re[1],
                        "content" : re[2],
                        "creat_date" : re[3]
                }
                order_file.append(t)
        data = order_file
        return json.dumps(data,ensure_ascii=False)
